package com.example.goods_manage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.goods_manage.dto.Goods;
import com.example.goods_manage.dto.request.GoodsRequest;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <P> @Author: SongKeCheng
 * <P> Description:
 * <P> Type: Interface
 * <P> Date: 2024/9/5:11:06
 */

public interface GoodsMapper extends BaseMapper<Goods> {
    int deleteByPrimaryKey(Integer id);

    int insert(Goods record);

    int insertSelective(Goods record);

    Goods selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Goods record);

    int updateByPrimaryKey(Goods record);

    /**
     * 分页查询
     * 设置 Page<Goods> page,后面有参数则需要使用 @Param 取别名
    */
    List<Goods> findGoods(Page<Goods> page, @Param("goodsRequest") Map<String, Object> goodsRequest);
}
